﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
using System.IO;
using System.Web.UI;
using System.Web.UI.Design;
using System.Web.UI.Design.WebControls;
using System.Web.UI.WebControls;
using System.Web;
using System.Text;
using System.Text.RegularExpressions;
using System.Drawing;
using System.Drawing.Design;
using System.Security;
using System.Security.Permissions;
using System.Resources;
using System.Reflection;
using System.Globalization;

//DataPager Version information 6.0.0
namespace PickGold.Controls
{
	/// <summary>
	/// UserControlLoader
	/// </summary>
	[ControlBuilder(typeof(PlaceHolderControlBuilder))]
	[ToolboxData(@"<{0}:UserControlLoader runat=""server"" />")]
	public class UserControlLoader : TemplateControl
	{
		private string _Src;

		[Bindable(true)]
		[DefaultValue("")]
		[Editor("System.Web.UI.Design.ImageUrlEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))]
		[UrlProperty]
		public string Src
		{
			set
			{
				this._Src = value;
			}
			get
			{
				return this._Src;
			}
		}

		public override string ID
		{
			get
			{
				if (string.IsNullOrEmpty(base.ID))
					base.ID = "_" + Guid.NewGuid().ToString("N");
				return base.ID;
			}
			set
			{
				base.ID = value;
			}
		}

		protected override void Render(HtmlTextWriter writer)
		{
			if (this.Visible && !string.IsNullOrEmpty(this._Src))
				this.Controls.Add(this.LoadControl(this._Src));
			base.Render(writer);
		}
	}
}
